package aspect;


import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class Myaspect {
    @AfterReturning("execution(* type.Simulator.getType())")
    public void methodical()
    {
        System.out.println("后置通知");
    }
    @Before("execution(* type.Simulator.getType())")
    public  void bfmethodical()
    {
        System.out.println("前置通知");
    }
    @Around("execution(* type.Simulator.getType())")
    public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable{
        //方法之前
        System.out.println("方法之前");
        Object reVal =pjp.proceed();
        //方法之后
        System.out.println("方法之后");
        return reVal;
    }

}
